/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package lineage.ui;

import java.awt.Color;

import javax.swing.JPanel;

/**
 * 面板.
 * 
 * @version 2014年2月11日下午2:38:32
 * @author jrwz
 */
public class L1Panel extends JPanel {
    private static final long serialVersionUID = 562778221702761731L;
    /** 组件的x坐标. */
    protected int _x;
    /** 组件的y坐标. */
    protected int _y;
    /** 组件的宽度. */
    protected int _width;
    /** 组件的高度. */
    protected int _height;

    protected L1Panel() {
    }

    /**
     * 初始化.
     * 如要添加其他组件,应在此方法之前.
     * 
     * @param flag
     *            - 是否立即显示
     */
    protected void init(boolean flag) {
        setLayout();
        setBackground();
        setBounds(_x, _y, _width, _height);
        add();
        setVisible(flag);
    }

    /**
     * 设置布局(默认空布局).
     */
    protected void setLayout() {
        setLayout(null); // 空布局(其上的组件可以任意调整位置)
    }

    /**
     * 设置组件颜色(默认白色).
     */
    protected void setBackground() {
        setBackground(Color.WHITE); // 设置面板背景颜色-白色
    }

    /**
     * 在此增加其他组件(默认什么也不加).
     */
    protected void add() {
    }
}
